<?php

namespace app\admin\validate;

use think\Validate;

class Seller extends Validate
{
    protected $rule = [
        'id' => 'require|number',
        'pageIndex' => 'require|number',
        'pageSize' => 'require|number',
        'name' => 'require',
        'category' => 'require|number',
        'sup_type' => 'require|number',
        'is_deal' => 'require|number',
        'ids' => 'require|array'
    ];

    //定义验证提示
    protected $message = [
        'id.require' => 'ID不能为空',
        'id.number' => 'ID参数错误',
        'pageIndex.require' => '页码参数不能为空',
        'pageIndex.number' => '页码参数错误',
        'pageSize.require' => '分页条数不能为空',
        'pageSize.number' => '分页条数参数错误',
        'name.require' => '名称不能为空',
        'category.require' => '渠道类型不能为空',
        'category.number' => '渠道类型参数错误',
        'sup_type.require' => '供应商类型不能为空',
        'sup_type.number' => '供应商类型参数错误',
        'ids.require' => 'IDs不能为空',
        'ids.array' => 'IDs参数错误',
    ];

    protected $scene = [
        'getList' => ['pageIndex','pageSize'],
        'save' => ['name','category','sup_type'],
        'detail' =>  ['id'],
        'update' => ['id','name','category','sup_type'],
        'delete' =>  ['ids']
    ];

}
